package org.example.exp3.exam4;

public class RemoteControl {
   public Command[] commandList;
   
   public void setCommandList(Command[] commandList) {
      this.commandList = commandList;
   }
   
   public void execute(int index) {
      if(index < 1 || index > 5) {
         System.out.println("没有这个按钮！");
      }
      commandList[index].control();
   }
}